<script>
function EP_eventHandler(evt) 
{
	// write the event to the text-area in the HTML page
	EP_logEvent(evt);
	
	switch(evt) {
		
		case 'MP3_LOADING':
			
			break;
		case 'MP3_BUFFERING':

			break;
		case 'MP3_PLAYING':
			
			// get track info
			var t = EP_getTrackInfo('ep_player');

			// write the event to the text-area in the HTML page
			EP_logEvent('playlistIndex: '+t.playlistIndex);
			EP_logEvent('location: '+t.location);
			EP_logEvent('title: '+t.title);
			EP_logEvent('annotation: '+t.annotation);
			EP_logEvent('creator: '+t.creator);
			EP_logEvent('info: '+t.info);
			EP_logEvent('image: '+t.image);
			EP_logEvent('album: '+t.album);
			EP_logEvent('trackNum: '+t.trackNum);
			EP_logEvent('link: '+t.link);
			EP_logEvent('----------------------------');

			break;			
		case 'MP3_PREV':

			break;				
		case 'MP3_NEXT':

			break;			
		case 'MP3_SELECT':
		
			// write the event to the text-area in the HTML page
			EP_logEvent("Select MP3 (#"+EP_getTrackInfo('ep_player').playlistIndex+") from playlist ...");
			
			break;
		case 'MP3_PAUSED':

			break;
		case 'MP3_COMPLETE':

			break;			
		case 'MP3_STOPPED':

			break;						
		default:
			break;
	}
}
</script>

<div class="post" style="width: 800px"><ul>

<?

foreach ($tracks as $i=> $track)
{
    echo $this->renderElement('track', array('track' => $track, 'index' => $i));
}

?>

</ul></div>
<? if ($total_results > 25): ?>
<div class="post">
    <a href="/post/<? echo $this->params['action']; if ($extra_page_arg) echo "/".$extra_page_arg; ?>/<? echo $page+1?>">Next</a>
</div>
<? endif; ?>
</div>

<?php

if ($this->action == "artist") echo $this->renderElement('event_list', array('events' => $events));
else if ($this->action == "latest") echo $this->renderElement('dj_list', array('djs' => $djs));
else if ($this->action == "tag") echo $this->renderElement('list', array('type' => 'tag_artists', 'data' => $tag_artists));
if ($tags) echo $this->renderElement('list', array('type' => 'tag', 'data' => $tags));

?>
<br style="clear: both" />